package com.pf.messageQueue.controller;

import com.pf.messageQueue.service.RedisMessageQueueService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/message/queue")
public class RedisMessageQueueController {

    @Autowired
    private RedisMessageQueueService redisMessageQueueService;


    /**
     * 生产数据
     */
    @GetMapping("/produceMessage")
    public void produceMessage() {
        // 每隔500毫秒生产一组数据
        redisMessageQueueService.lpush();
    }
}
